package ngames.com.sushitv.temp.Module;

import android.os.Handler;
import android.util.Log;


import java.util.ArrayList;
import java.util.List;

import ngames.com.sushitv.temp.Class.FanMade;

/**
 * Created by edmond on 16-7-29.
 */
public class FanMadeFactory {
    private List<String> bannerUrls = new ArrayList<>();
    private List<FanMade> fanMadesArray = new ArrayList<>();

    public void initData(final Handler handler){
        new Thread(){
            @Override
            public void run() {
                super.run();
                try {
                    Thread.sleep(1000);
                    bannerUrls.add("http://www.pptbz.com/pptpic/UploadFiles_6909/201204/2012041411433867.jpg");
                    bannerUrls.add("http://h.hiphotos.baidu.com/image/pic/item/8718367adab44aed098e6de0b11c8701a08bfbf6.jpg");
                    bannerUrls.add("http://c.hiphotos.baidu.com/image/pic/item/9825bc315c6034a8e47e6d85c913495409237612.jpg");
                    bannerUrls.add("http://f.hiphotos.baidu.com/image/pic/item/9358d109b3de9c82c4f95c8f6e81800a19d84315.jpg");
                    bannerUrls.add("http://a.hiphotos.baidu.com/image/pic/item/1f178a82b9014a90f69971ecab773912b31bee3f.jpg");
                    Log.d("FeaturedFractory","Here");
                    handler.sendEmptyMessage(0);
                } catch (InterruptedException e) {
                    e.printStackTrace();
                }
            }
        }.start();
    }

    public void refreshData(final Handler handler){
        new Thread(){
            @Override
            public void run() {
                super.run();
                try {
                    Thread.sleep(1000);
                    bannerUrls = new ArrayList<String>();
                    bannerUrls.add("http://h.hiphotos.baidu.com/image/pic/item/3801213fb80e7bec43f0523e2b2eb9389a506bc2.jpg");
                    bannerUrls.add("http://pic3.nipic.com/20090622/2605630_113023052_2.jpg");
                    bannerUrls.add("http://b.hiphotos.baidu.com/image/pic/item/908fa0ec08fa513d17b6a2ea386d55fbb2fbd9e2.jpg");
                    bannerUrls.add("http://g.hiphotos.baidu.com/image/pic/item/2cf5e0fe9925bc313ab004755adf8db1ca137069.jpg");
                    Log.d("FeaturedFractory","Here");
                    handler.sendEmptyMessage(2);
                } catch (InterruptedException e) {
                    e.printStackTrace();
                }
            }
        }.start();
    }

    public List<FanMade> getFanMadeSeriesArray() {
        return fanMadesArray;
    }

    public List<String> getBannerUrls() {
        return bannerUrls;
    }
}
